package com.cogwheel.framework.init;

import java.util.ArrayList;

import javax.media.opengl.GL2;
import com.cogwheel.framework.graphics.*;
import com.cogwheel.framework.graphics.ui.*;
import com.cogwheel.framework.util.*;
import com.cogwheel.framework.util.CAssets;

public class CTestScreen extends CScreen{
	private static final long serialVersionUID = 1L;
	private ArrayList<CSprite> Items = new ArrayList<CSprite>();
	
	private boolean iSceneLoaded = false;
	
	public CTestScreen(String name){
		super(name); 
	}
	
	@Override
	public void CWGLoadScene(GL2 gl)
	{
		this.Items.add(new CSprite("UI_LOGIN_BACKGROUND", new CRectangle(400, 300, 800, 600)));
		this.Items.add(new CAnim("CATWALK", new CRectangle(400, 300, 2048, 128), false, 14)); //CRectangle arguments should hold the FINAL width and height!
		this.Items.add(new CCursor("UI_CURSOR", new CPoint(25, 25)));
		iSceneLoaded = true;
	}
	
	@Override
	public void CWGUpdate(){
		for (CSprite sprite : Items){
			sprite.CWGUpdate(); 
		}
	}
	
	@Override
	public void CWGDrawScene(GL2 gl){
		if (CAssets.iLoaded && iSceneLoaded){
			for(CSprite sprite : Items){
				sprite.CWGDraw(gl);
			}
		}
	}
}
